package cn.lotusnut.rabbitmqboot.kill;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author JiangMing Zhou
 * @Date 2022/12/1 16:18
 * @Version 1.8
 */
@Slf4j
@Component
public class KillProvider {
    @Resource
    private AmqpTemplate amqpTemplate;

    public void sendMessage(String message) {
        log.debug("秒杀生产者:" + message);
        amqpTemplate.convertAndSend("kill_exchange", "kill", message);
    }

}
